/**

This file is part of MaCI/GIMnet.

MaCI/GIMnet is free software: you can redistribute it and/or modify it 
under the terms of the GNU Lesser General Public License as published 
by the Free Software Foundation, either version 3 of the License, or 
(at your option) any later version.

MaCI/GIMnet is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public 
License for more details.

You should have received a copy of the GNU Lesser General Public 
License along with GIMnet. (See COPYING.LESSER) If not, see 
<http://www.gnu.org/licenses/>.

**/
#ifndef RAYCLUSTER_H 
#define RAYCLUSTER_H

#include <vector>
#include "Primitive.h"

#define RANGE_EXCEEDED -1

/*
Class for defining ray clusters (for laser scanners).
*/

struct TRayInfo
{
  int index;
  float angle;
  float range;
};

class CRayCluster : public CPrimitive
{
  public:
    bool IsVisible;
    
    
    CRayCluster(CObject *ParentObject, dSpaceID SpaceID, dBodyID parentBodyID, 
    dReal *posOffset, dMatrix3 rotOffset, int numRays, float range, float angle1, float angle2);
    
    ~CRayCluster();
    
    void Draw();

    void Set();
    
    const std::vector<TRayInfo*>* GetRayInfo();
    
  private:
    int numRays;
    float range;
    float angle1, angle2;
    dReal posOffset[3]; 
    dMatrix3 rotOffset;
    std::vector<dGeomID> rays;
    std::vector<TRayInfo*> RayInfos;
    std::vector<std::vector<float> > coords;
};

#endif //RAYCLUSTER_H
